package items; 

import flixel.FlxSprite;
import flixel.FlxG;

class Pill extends FlxSprite{
	private var base_y: Float;
	private var time: Float;

	public function new(_x: Float, _y: Float){
		super(x, y, "assets/images/tileset01.png");
		animation.frameIndex = 1;
		reset(x, y);
	};


	public override function reset(_x: Float, _y: Float){
		super.reset(_x, _y);
		base_y = _y;
		time = 0;
	}

	public override function update(){
		super.update();
		time += FlxG.elapsed;
		y = base_y + 3*Math.sin(time*6);
	}
}